// 主路由入口,管理所有子路由
import express from 'express';
import authRouter from '../server/auth/AdminAPI.js';
import userRouter from '../server/User/UserAPI.js';
import uploadRouter from '../server/upload/UploadAPI.js';
import foodRouter from '../server/Food/FoodAPI.js';
import foodCategoryRouter from '../server/FoodCategory/FoodCategoryAPI.js';

const router = express.Router();

// 路由健康检查
router.get('/health', (req, res) => {
  res.json({ status: 'ok', message: '服务器运行正常' });
});

// 注册认证路由
router.use('/auth', authRouter);

// 注册用户路由
router.use('/user', userRouter);

// 注册文件上传路由
router.use('/upload', uploadRouter);

// 注册餐品路由
router.use('/foods', foodRouter);

// 注册餐品分类路由
router.use('/food-categories', foodCategoryRouter);

export default router;